package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.SportMapper;
import com.example.pojo.Sport;
import com.example.service.ISportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SportServiceImpl extends ServiceImpl<SportMapper, Sport> implements ISportService {

    @Autowired
    private SportMapper sportMapper;

    public List<Sport> getAllSports() {
        return sportMapper.getAllSports();
    }

    public List<Sport> getSportById(Long sportId) {
        return sportMapper.getSportById(sportId);
    }
}
